package com.travel.lib.base.retrofit;

import rx.Subscriber;


public abstract class APISubscriber<T> extends Subscriber<T> {

    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {
        ResponseStatusErrorManager.exceptionHandler(e);
        haveError();
    }

    @Override
    public void onNext(T t) {
        statusSuccess(t);
    }
    // （ 状态不为0 和异常错误）
    protected void haveError() {

    }

    //请求成功
    protected abstract void statusSuccess(T t);
}
